package com.globallogic.draw;

public class Circle extends DrawObject implements Drawable {
    
	public Circle(int radius) {
		
		if (radius <= 0) {
		
			throw new IllegalArgumentException();
			
		}
		
		this.radius = radius;
		this.drawChar = 'c';
	}
	
	public float calculateSquare() {

		return PI*radius*radius;
				
	}

	public boolean isPointInside(int x, int y) {
		
		return (((x - radius)*(x - radius) + (y - radius)*(y - radius)) < radius*radius);
		
	}

	@Override
	public String toString() {
		
		return this.getClass().getSimpleName();
		
	}

	private int radius;

	@Override
	public int getLenght() {
		return radius;
	}
	
}
